#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    connect(&thread,&Thread::notify,this,&MainWindow::handle);
    thread.start();
}

void MainWindow::handle()
{
    int value=ui->lcdNumber->intValue();
    value--;
    if(value>=0)
    {
        ui->lcdNumber->display(value);
    }

}

MainWindow::~MainWindow()
{
    delete ui;
}

